import com.google.common.collect.Lists;

import java.util.List;

/**
 * @author ZhangLin
 * @date 2018/6/10 11:47
 */
public class Permutation {

    public void pac(List<String> original, List<String> present, List<List<String>> all) {
        for (int i =0 ;i<original.size();i++) {
            List<String> ori = Lists.newArrayList(original);
            List<String> pre = Lists.newArrayList(present);
            pre.add(original.get(i));
            if (original.size() == 1){
                all.add(pre);
                return;
            }
            ori.remove(i);
            pac(ori, pre, all);
        }
    }
}
